#encoding=utf-8
'''
jk409@qq.com created by 2016-6-3
'''
import sys
def men(arge):
    data={}
    #定义顶部菜单顺序
    head_list = ["index","report","zdh","file","check","users","hosts"]
    ##============================================================================================================
    #定义顶部菜单导航
    head_men = {
        "index":["仪表盘","/",True,""],
        "report":["报表统计","/report",True,""],
        "zdh":["自动化","/zdh",True,""],
        "file":["文件分发","/file",True,""],
        "check":["巡检监控","/check",True,""],
        "users":["用户管理","/users",True,""],
        "hosts":["主机管理","/hosts",True,""]
    }
    ##============================================================================================================
    #定义左边的菜单导航
    left_men = {
        "index":[["仪表盘","/",True,""]],
        "zdh":[["自动化","/zdh",True,""],["环境部署","",True,""]],
        "report": [["报表统计","/report",True,""],["访问统计图","/report/nginx_access",False,""],["流量图","/report/line",True,""]],
        "file":[["文件管理","/file",True,""],["文件同步","/file/rsync_file",True,""],["目录同步","/file/rsync_dir",True,""]],
        "check":[["巡检监控","/check",True,""],["数据采集","/check/host",True,""],["主机信息","/check/info",True,""]],
        "users":[["用户管理","/users",True,""],["添加用户","/users/add",True,""],["户组管理","/users_group",True,""]],
        "hosts":[["主机管理","/hosts",True,""],["添加主机","/hosts/add",False,""]],
    }
    ##============================================================================================================
    if arge not in head_men:return False
    head_men[arge][3]="active"
    #left_men[arge][0][3]="active"
    #left_men=left_men[arge]
    ##============================================================================================================
    data["head_list"] = head_list
    data['head_men'] = head_men
    data["left_men"] = left_men
    #print(head_men)
    return data

if __name__ == '__main__':
    data=men('zdh')
    print(data)
    #for key in hh:
     #   print(key,data["head_men"].get(key))

    for key in data['left_men']:
        print(key)
    pass
    for i in data['head_list']:
        print(i,data['head_men'][i][0],data['head_men'][i][3],data['left_men'][i])
        for n in data['left_men'][i]:
            if n[2]:
                print(n[0],n[1])